package com.sdtest.perfmall.product.controller;

import com.sdtest.common.utils.PageUtils;
import com.sdtest.common.utils.R;
import com.sdtest.perfmall.product.feign.WareProviderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author LiWen
 * @version 1.0
 * @Date: 2020-11-17 09:53
 * @Description: 远程调用库存信息
 */
@RestController
@RequestMapping("product/feign")
public class ProductWnstockController {

    @Autowired
    WareProviderService wareProviderService;

    @RequestMapping("/list" )
    public R list(@RequestParam Map<String, Object> params) {
        R list = wareProviderService.list(params);
        PageUtils page = (PageUtils) list.get("data");

        return R.ok().put("page", page);
    }

    @RequestMapping("/list/1" )
    public R listMy(@RequestParam Map<String, Object> params) {
        R list = wareProviderService.list(params);
        PageUtils page = (PageUtils) list.get("data");

        return R.ok().put("page", page);
    }


}
